package com.tsfot.spider.bean;

import java.util.List;
import java.util.Map;


/**
 * 配置信息
 * @author frank0
 *
 */
public class SpiderConfig {
	
	private String projectName;

	private String tableName;
	
	private String queryUrl;
	
	private String title;
	
	private String listCssQuery;
	
	private String aLabelCssQuery;
	
	/**
	 * 配置为key-value 
	 * key表示 存入数据库字段名称，value为解析时的正则表达式或者是CSS样式
	 */
	private Map<String,String> dataKeyMap;
	
	private String imageSavePath;
	
	private String paginateCssQuery;
	
	private List<String> exceptUri;
	
	private boolean auto=false;
	
	private Integer totalPage;
	
	/**
	 * 进行初始化
	 */
	public void init(){
		//验证参数完整性
		if(!validParamsIntact()){
			throw new IllegalArgumentException();
		}
		if(this.totalPage==null||this.totalPage==0){
			this.auto=true;
		}
	}
	
	private boolean validParamsIntact() {
		
		return true;
	}

	public String getQueryUrl() {
		return queryUrl;
	}



	public void setQueryUrl(String queryUrl) {
		this.queryUrl = queryUrl;
	}



	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getListCssQuery() {
		return listCssQuery;
	}

	public void setListCssQuery(String listCssQuery) {
		this.listCssQuery = listCssQuery;
	}

	public String getaLabelCssQuery() {
		return aLabelCssQuery;
	}

	public void setaLabelCssQuery(String aLabelCssQuery) {
		this.aLabelCssQuery = aLabelCssQuery;
	}

	public Map<String, String> getDataKeyMap() {
		return dataKeyMap;
	}

	public void setDataKeyMap(Map<String, String> dataKeyMap) {
		this.dataKeyMap = dataKeyMap;
	}

	public String getImageSavePath() {
		return imageSavePath;
	}

	public void setImageSavePath(String imageSavePath) {
		this.imageSavePath = imageSavePath;
	}

	public String getPaginateCssQuery() {
		return paginateCssQuery;
	}

	public void setPaginateCssQuery(String paginateCssQuery) {
		this.paginateCssQuery = paginateCssQuery;
	}

	public List<String> getExceptUri() {
		return exceptUri;
	}

	public void setExceptUri(List<String> exceptUri) {
		this.exceptUri = exceptUri;
	}

	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	public boolean isAuto() {
		return auto;
	}

	public void setAuto(boolean auto) {
		this.auto = auto;
	}

	public Integer getTotalPage() {
		return totalPage;
	}

	public void setTotalPage(Integer totalPage) {
		this.totalPage = totalPage;
	}

	public String getProjectName() {
		return projectName;
	}

	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}
}
